<template>
	<view class="qiyezhuye">
		<view v-if="!companyData.shangxian">
				<view class="user-top">
					<!-- 标题栏 -->
					<u-navbar :title='title' :safeAreaInsetTop="true" :placeholder='true' :fixed="true" leftIcon="arrow-left"
						:titleStyle='titleStyle' @leftClick="back" v-if="isFenxiang=='0'"></u-navbar>
						
					<u-navbar :title='title' :safeAreaInsetTop="true" :placeholder='true' :fixed="true" leftIcon="home"
						:titleStyle='titleStyle' @leftClick="goHome" v-if="isFenxiang=='1'"></u-navbar>
				</view>
				
				<!-- 公司信息 -->
				<CompanyInfo v-model:company-data="companyData" v-model:danwei-type="danweiType" :location="location" :comcode="comcode"
					:vcode="vcode" v-model:fromCompanyInfo="fromCompanyInfo" v-model:is-jiankong="isJiankong" v-model:jiankongLoading="jiankongLoading" 
					:tabList="tabList" :ids="id" :qytype="danweiType" v-model:tabIndex="tabIndex" v-model:tabName="tabName" :companyName="companyName" @tabClick="tabClick" />
				
				<!--筛选 -->
				<view class="shaixuan " :class="isFixed ? 'isFixed' :''" :style="{top: titleTop + 'px'}">
					<view class="xmtab">
						<u-tabs @click="tabClick" :list="tabList" lineWidth="58rpx" lineHeight="6rpx"
							itemStyle="width:25%;height:86rpx;line-height:86rpx;padding:0;"
							inactiveStyle="color: #6C717E;font-size: 28rpx;"
							activeStyle="color: #2F6DFE;font-size:28rpx;font-weight:bold;" lineColor="#2F6DFE" :current="tabIndex"  :keyName="'name'">
							</u-tabs>
						<view class="line"></view>
					</view>
					
					<view class="search-box" v-if="tabName=='项目信息'" @click="inputClick">
						<u-input  placeholder="按业务，或产品搜索历史项目"  placeholderStyle="color:#6B6B6B" maxlength="15" v-model="keywords2" :disabled="!xmxxAllow ?true :false" disabledColor="#e5e8ec"  confirm-type="clickSearch"  @confirm="searchFn" :style="{pointerEvents:!xmxxAllow ? 'none' :'auto' }">
							<template slot="suffix">
								<image src="@/static/img/qiqing-serch.png" class="search-icon" @click="clickSearch"></image>
							</template>
						</u-input>
					</view>
					<view class="filter-box" v-if="tabName=='项目信息'">
						<view class="filter-item" :class="xiangmushaixuanShow ? 'active':''" @click="popupFn('danwei')">
							<view :style="{color:!xmxxAllow ?'#aeafb3' :'#3B3E45'}" >{{initshaixuanName}}</view>
							<image src="https://img.bidcenter.com.cn/uni/arrowUp.png" mode="widthFix" v-if="xiangmushaixuanShow"></image>
							<image src="https://img.bidcenter.com.cn/uni/qiqing/xiala2.png" mode="widthFix" v-else></image>
						</view>
						<view class="filter-item" :class="diquShow ? 'active':''" @click="popupFn('diqu')">
							<view :style="{color:!xmxxAllow ?'#aeafb3' :'#3B3E45'}">{{initDiquName}}</view>
							<image src="https://img.bidcenter.com.cn/uni/arrowUp.png" mode="widthFix" v-if="diquShow"></image>
							<image src="https://img.bidcenter.com.cn/uni/qiqing/xiala2.png" mode="widthFix" v-else></image>
						</view>
						<view class="filter-item" :class="timeShow ? 'active':''" @click="popupFn('time')">
							<view :style="{color:!xmxxAllow ?'#aeafb3' :'#3B3E45'}">{{dateText}}</view>
							<image src="https://img.bidcenter.com.cn/uni/arrowUp.png" mode="widthFix" v-if="timeShow"></image>
							<image src="https://img.bidcenter.com.cn/uni/qiqing/xiala2.png" mode="widthFix" v-else></image>
						</view>
					</view>
					<!-- 项目信息共计条数 -->
					<view class="total" v-if="xmxxLength>0 &&tabName=='项目信息'">
						共计
						<u-loading-icon size="18" v-if="xmxxStatus"></u-loading-icon>
						<text v-else>{{xmxxLength}}</text>
						条信息
					</view>
				</view>
				
				<!-- 单位 -->
				<view class="filterWrap" :style="{top: topHeight + 'px'}" v-show="xiangmushaixuanShow">
					<u-overlay :show="xiangmushaixuanShow" @click="closeWrap"></u-overlay>
					<view class="filterCont filterCont2">
						<view class="danwei-box">
							<view class="title">
								选择单位类型
							</view>
							<view class="tagwrap">
								<view v-for="(item,index) in xiangmushaixuanList" :key="index" style="position: relative;">
									<u-tag :type="xiangmuType==item.key ? 'primary' : 'info'"
										:plain="xiangmuType==item.key ? true : false" :text="item.value"
										@click="xiangmuTypeClick(item)">
									</u-tag>
								</view>
							</view>
							<view class="filter-foot d-f">
								<view class="cancel-btn" @click="xiangmuTypeReset">
									<image src="https://img.bidcenter.com.cn/uni/chongzhi.png" class="chongzhiIcon"></image>重置
								</view>
								<view class="confirm-btn" @click="xiangmuTypeConfirm">确认</view>
							</view>
						</view>
					</view>
				</view>
				<!-- 地区 -->
				<view class="filterWrap" :style="{top: topHeight + 'px'}" v-show="diquShow">
					<u-overlay :show="diquShow" @click="closeWrap"></u-overlay>
					<view class="filterCont filterCont2">
						<diqu v-model:initDiqu='initDiqu' v-model:areaPop="diquShow" @searchFn="searchFn" />
					</view>
				</view>
				
				<!-- 时间 -->
				<view class="filterWrap" :style="{top: topHeight + 'px'}" v-show="timeShow">
					<u-overlay :show="timeShow" @click="closeWrap"></u-overlay>
					<view class="filterCont filterCont2">
						<listTime v-model:init-time-check="initTimeCheck" v-model:startDate="startDate" v-model:endDate="endDate"
							v-model:dateText="dateText" v-model:timePop="timeShow" @searchFn="searchFn" />
					</view>
				</view>
				
				<!-- 未开通情况 -->
				<Weikaitong v-model:tab-name="tabName" v-model:location="location" v-if="((!zrmAllow && !isFufeihuiyuan) || (tabName=='招标分析' || tabName=='中标分析' || tabName=='代理分析') && !xmxxAllow) && tabName !='项目信息' && tabName !='查企业'"/>
				
				<!-- 次数用尽情况 1.付费会员次数用尽2.付费会员没有查人脉权限-->
				<Cishuyongjin v-model:tab-name="tabName" :location="location" v-model:page-url="pageUrl"  @lijigoumai="tobuy" v-if=" (zrmshengyucishu<=0 && tabName=='找人脉' && zrmAllow )|| (tabName=='找人脉' && isFufeihuiyuan && !zrmAllow)"/>
				
				<!-- 企业信息库 -->
				<Qiyexinxiku   v-model:ids="id" v-model:type="type" v-model:yzquickjiami="yzquickjiami" v-model:bottomHight="bottomHight" v-model:qyxxkIsbottom="qyxxkIsbottom"   v-if="tabName =='企业信息库' "/>
				
				<!-- 项目信息列表 -->
				<Xiangmuxinxi  v-model:xmxxForm="xmxxForm"  v-model:xmxxIsbottom="xmxxIsbottom" v-model:isUpdateXmxx="isUpdateXmxx" v-model:bottomHight="bottomHight" v-model:xmxxAllow="xmxxAllow" v-model:isClickSearch="isClickSearch" v-model:xmxxLength="xmxxLength" v-model:xmxxStatus="xmxxStatus"  v-if="tabName =='项目信息' "/>
				
				<!-- 招标分析 -->
				<Zhaobiaofenxi :comcode="comcode" :vcode="vcode" v-model:companyName="companyName" v-model:bottomHight="bottomHight"  v-if="tabName =='招标分析' && xmxxAllow " />
				
				<!-- 中标分析 -->
				<Zhongbiaofenxi :comcode="comcode" :vcode="vcode" v-model:companyName="companyName" v-model:bottomHight="bottomHight"  v-if="tabName =='中标分析'&& xmxxAllow " />
				
				<!-- 代理分析 -->
				<Dailifenxi :comcode="comcode" :vcode="vcode" v-model:companyName="companyName" v-model:bottomHight="bottomHight"  v-if="tabName =='代理分析' && xmxxAllow " />
				
				<!-- 找人脉 -->
				<Zhaorenmai :comcode="comcode" :vcode="vcode" v-model:bottomHight="bottomHight" v-model:companyName="companyName" v-model:zrmIsbottom="zrmIsbottom" v-model:zrmjiesuoShow="zrmjiesuoShow" v-model:zrmshengyucishu="zrmshengyucishu"  v-model:danweiType="danweiType"  v-model:keywords2="keywords2" v-if="tabName =='找人脉' && zrmAllow && zrmshengyucishu>0"  @getGongneng="getGongneng"/>
				
				<!-- 查企业 -->
				<Chaqiye :comcode="comcode" :vcode="vcode" v-model:company-data="companyData" v-model:companyName="companyName" v-model:danwei-type="danweiType"  v-model:bottomHight="bottomHight"  v-model:cqyjiesuoShow="cqyjiesuoShow" v-model:cqyshengyucishu="cqyshengyucishu"   v-if="tabName =='查企业'" @getGongneng="getGongneng"/>
				
				
				
				<!-- 底部-->
				<view class="footer" :style="{paddingBottom: bottomHight ==34 ? bottomHight+'px' :'20rpx'}" >
					<view class="footer-left d-b-c ">
						<view class="footer-left-item" @click="kefuClike">
							<image src="https://img.bidcenter.com.cn/uni/kefu.png"></image>
							<view>客服</view>
						</view>
						<view class="footer-left-item" @click="goreport">
							<image src="https://img.bidcenter.com.cn/uni/qiqing/baogao.png" mode=""></image>
							<view>报告</view>
						</view>
						<view class="footer-left-item" @click="shareClick">
							<image src="https://img.bidcenter.com.cn/uni/detail/fenxiang.png" mode=""></image>
							<view>分享</view>
						</view>
						<view class="footer-left-item" @click="guanzhuClick" >
							<image src="https://img.bidcenter.com.cn/uni/user/shoucang.png" mode="" v-if="!isJiankong">
							</image>
							<image src="https://img.bidcenter.com.cn/uni/user/shoucang_on.png" mode="" v-else></image>
							<view>关注</view>
						</view>
					</view>
				</view>
		</view>
		
		<!-- 监控超出数量 -->
		<PopupJiankongchaochu v-model:chaochuShow="chaochuShow" :location="location"/>
		
		<!-- 分享 -->
		<popupShare v-model:showShare="showShare" :comcode="comcode" :vcode="vcode" v-model:title="companyData.name" :from="shareFrom" v-model:danweiType="danweiType"/>
	
		<!-- 功能购买弹窗-->
		<popupTuoke   v-model:showBuyxinxi="showBuyxinxi" v-model:showBuycharenmai="showBuycharenmai" v-model:isNeedQuanxian="isNeedQuanxian" 
		v-model:comcode="comcode" v-model:vcode="vcode"  v-model:danweiType="danweiType" v-model:companyName="companyData.name" v-model:keywords2="keywords2" :popupfrom.sync="popupfrom"/>
		
		<!-- 访问达到上限提示 -->
		<view class="pinfanTips" v-if="companyData.shangxian">
			<view class="pinfan">
				<u-image src="//img.bidcenter.com.cn/uni/detail/upper.png"></u-image>
			</view>
		
			<view class="text1">
				休息，只为更好地奋力前行
			</view>
			<view class="text2">
				今日查看公司信息数量达日最大上限，明日再来吧。
			</view>
			<view class="text2">
				如有疑问请与客服联系：<text style="color: #2F7FFF;">400-810-9688</text>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		areaMap,
		timeObj
	} from '@/util/diction.js';
	import CompanyInfo from './components/CompanyInfo.vue';
	import Weikaitong from './components/Weikaitong.vue';
	import Cishuyongjin from './components/Cishuyongjin.vue';
	import Qiyexinxiku from './components/Qiyexinxiku.vue';
	import Xiangmuxinxi from './components/Xiangmuxinxi.vue';
	import Zhaobiaofenxi from './components/Zhaobiaofenxi.vue';
	import Zhongbiaofenxi  from './components/Zhongbiaofenxi.vue';
	import Dailifenxi  from './components/Dailifenxi.vue';
	import Zhaorenmai  from './components/Zhaorenmai.vue';
	import Chaqiye  from './components/Chaqiye.vue';
	
	import PopupJiankongchaochu from './components/PopupJiankongchaochu.vue';
	import listTime from '@/components/list-time/list-time.vue';
	import popupShare from '@/components/popup-share/popup-share.vue'
	
	import popupTuoke from '@/components/popup-tuoke/popup-tuoke.vue'
	
	export default {
		components: {
			CompanyInfo,
			Xiangmuxinxi,
			Weikaitong,
			Cishuyongjin,
			Qiyexinxiku,
			Zhaobiaofenxi,
			Zhongbiaofenxi,
			Dailifenxi,
			Zhaorenmai,
			Chaqiye,
			PopupJiankongchaochu,
			listTime,
			popupShare,
			popupTuoke,
		},
		data() {
			return {
				location: 11383,
				navbarBgShow: false,
				id:'',//企业信息库所用参数
				type:'',
				title: '企业主页',
				companyName:'',
				titleStyle: 'color:#000;font-size:32rpx;font-weight:600;',
				vcode: "",
				comcode: "",
				yzquickjiami:'',//企业信息库所用参数
				
				xmTab: [
					{
						name: "企业信息库",
					},
					{
						name: "项目信息"
					},
					{
						name: "招标分析"
					},
					{
						name: "中标分析"
					},
					{
						name: "代理分析"
					},
					{
						name: "找人脉"
					},
					{
						name: "查企业"
					},
				],
				tabIndex: 0,
				tabName:'查企业',
				// 筛选是否悬浮
				isFixed: false,
				ispopClick: false,
				//是否监控
				isJiankong: false,
				//是否收藏
				isshoucang: false,
				// 安全距离
				bottomHight: 0,

				// 公司信息
				companyData: {},
				fromCompanyInfo:false,
				// 底部高
				bottomH: 0,
				topHeight: 0,
				titleTop: 0,
				//作为xx单位
				xiangmushaixuanShow: false,
				danweiText: '业主',
				danweiType: '2',
		
				//地区弹窗
				diquShow: false,
				diquText: '全国',
				initDiqu: '',
				//时间弹窗
				dateText: "近一年",
				timeObj: timeObj,
				timeShow: false,
				initTimeCheck: 11,
				startDate: '',
				endDate: '',
				keywords:'',
				xmxxForm:{
					danweiType: '',
					company:'',
					keywords:'',
					keywords2:'',
					time: 11, //3:近三天；7：近一周；30：近一月；90：近三月；180：近半年；11：近一年
					stime: '',
					endtime: '',
					diqu: '全国',
					areacode: '',
					xiangmuType:'0',
					comcode:'',
					vcode:''
				},
				xmxxIsbottom:false,
				
				//监控超出限制
				chaochuShow:false,
				
				//企业信息库
				qyxxkIsbottom:false,
			
				// 找人脉
				zrmIsbottom:false,
				
				jiankongLoading:true,
				
				//未开通
				showWeikaitong:false,
				isAllow:false,
				isCishuyongjin:false,
				
				
				changeTab:[],
				//是否项目信息执行搜索方法
				isUpdateXmxx:false,
				pageUrl:'',
				
				//是否为分享
				isFenxiang:'0',//0不是分享页  1 是分享页
				
				// fixed悬浮位置
				tabTop:0,
				
				//解锁找人脉、剩余次数
				zrmjiesuoShow:false,
				zrmshengyucishu:0,
				
				//解锁查企业，剩余次数
				cqyjiesuoShow:false,
				cqyshengyucishu:0,
				
				//是否由标讯或者工程页跳转进来 0为否 1是
				fromXinxi:'',
				
				// 项目信息keyword
				keywords2:"",
				
				//分享
				showShare:false,
				shareFrom:'qiqing',
				
				
				
				// 各tab权限相关
				xmxxAllow:false,				
				cqyAllow:false,				
				zrmAllow:false,
				
				//点击搜索时，xmxxform未更新，所以组件内不会执行搜索事件，所以加上此参数，用于更新搜索数据
				isClickSearch:false,
				
				//功能购买弹窗--showBuyxinxi买会员+查人脉  showBuycharenmai买查人脉
				isNeedQuanxian:false,
				showBuyxinxi:false,
				showBuycharenmai:false,
				
				isFufeihuiyuan:false,
				isgoumai:'0',
				
				//项目信息更换接口后需要的参数
				xmxxLength:0,
				initshaixuanName:"招标项目",
				xiangmuType:"0",
				changeXiangmuName:true,
				xmxxStatus:true,
				popupfrom:'qiqing',
				userInfo:uni.getStorageSync('userInfo') || {},
			}
		},
		onReady() {
			let app = uni.getSystemInfoSync()
			this.bottomHight = app.safeAreaInsets.bottom //屏幕底部安全距离
			// console.log('屏幕底部安全距离', this.bottomHight) //34
			
			// 获取顶部导航栏的高度
			const query = uni.createSelectorQuery().in(this);
			query.select('.user-top').boundingClientRect(data => {
				this.titleTop = data && data.height
			}).exec();
			
			//fixed悬浮位置
			uni.createSelectorQuery().select('.xmtab').boundingClientRect(res=>{
				this.tabTop = res.top
			}).exec();	
			// this.getIshuiyuan()
			
		},
		onPageScroll(e) {
			//顶部
			if (e.scrollTop > 30) {
				this.title = this.companyData.name;
				if(this.title=='企业主页'){
					this.titleStyle = 'color:#000;font-size:32rpx;font-weight:600;text-align:center;'
				}else{
					this.titleStyle = 'color:#000;font-size:32rpx;font-weight:600;width:60%;margin-right:128rpx;text-align:left;'
				}
			} else {
				this.title = `企业主页`
				this.titleStyle = 'color:#000;font-size:32rpx;font-weight:600;'
			}
			//ispopClick=true 代表点击的是本页切换身份弹窗，不是弹窗的情况下，当滚动条》200时，裁定为
			if (!this.ispopClick) {
				if(this.tabName=='项目信息'){
					if (e.scrollTop > this.tabTop && this.userInfo.isHuiyuan && this.xmxxLength>7) {
						this.isFixed = true
					} else {
						this.isFixed = false
					}
				}else{
					if (e.scrollTop > this.tabTop && this.userInfo.isHuiyuan ) {
						this.isFixed = true
					} else {
						this.isFixed = false
					}
				}
			}

		},
		// 页面滚动到底部的事件（不是scroll-view滚到底），常用于下拉下一页数据
		onReachBottom() {
			// console.log('到底部了')
			//用于项目信息滑到底部时，加载下一页数据
			if(this.tabName=="项目信息"){
				this.xmxxIsbottom=true
			}else if(this.tabName=="企业信息库"){
				this.qyxxkIsbottom=true
			}else if(this.tabName=="找人脉"){
				this.zrmIsbottom=true
			}
			
		},
		onShow() {
			//找人脉购买后返回此页，更新权限接口
			if(this.isgoumai=='1'){
				this.getGongneng()
			}
		},
		watch: {
			danweiType(a, b) {
				//ispopClick=true 代表点击的是本页切换身份弹窗，这个监听是指企业信息里切换身份后，执行下搜索接口
				if (a !== b && !this.ispopClick &&this.fromCompanyInfo) {
					this.keywords=''
					this.tabName= '项目信息'
					this.tabIndex=0
					this.xiangmuType='0'
					this.changeXiangmuName=true
					// console.log('切换身份',this.tabName,this.tabIndex)
					if(this.tabName == '项目信息'){
						this.searchFn()	
						this.isClickSearch=false
						this.isUpdateXmxx=true
					} 
					if(a==2){
						//fromCompanyInfo为true,代表来自企业基本信息更换企业身份，例从业主->供应商，那tabname及底部的内容要更新，
						if((this.tabName=='中标分析' ||this.tabName=='代理分析') && this.fromCompanyInfo){
							this.tabName='招标分析'
						}
					}
					if(a==5){
						//fromCompanyInfo为true,代表来自企业基本信息更换企业身份，例从业主->供应商，那tabname及底部的内容要更新，
						if((this.tabName=='招标分析' ||this.tabName=='代理分析') && this.fromCompanyInfo){
							this.tabName='中标分析'
						}
					}
					if(a==1){
						//fromCompanyInfo为true,代表来自企业基本信息更换企业身份，例从业主->供应商，那tabname及底部的内容要更新，
						if((this.tabName=='招标分析' ||this.tabName=='中标分析') && this.fromCompanyInfo){
							this.tabName='代理分析'
						}
					}
				}
			},
		
			companyData(a, b) {
				if(JSON.stringify(a)!=="{}"){
					this.xmxxForm= Object.assign({}, this.xmxxForm,{
						company:a.name,
					})
				}
			},
		},
		onLoad(options) {
			// JSON.parse
			//console.log(1111,options)

			//如果没有绑定进入到首页--策划稿中要求
			if(!this.userInfo.isLogin){
				uni.switchTab({
					url:'/pages/index/index'
				})
				return;
			}
			//详情页跳转时使用moSentiment字段 20250321粉萍
			this.pageUrl = this.$page.fullPath
			// console.log(this.$page.fullPath)
			this.id=  options.id ? options.id : '285536824'
			this.companyName = options.companyName ? options.companyName : '企业主页',
			this.danweiType = options.type ? (options.type=='4' ? '5' :options.type) :'2';
			this.type=options.type?options.type:'2'
			this.keywords2 = options.keywords2?options.keywords2:''

			this.isFenxiang=options.isFenxiang?options.isFenxiang:'0'
			
			this.comcode=  options.comcode ? options.comcode : "AA1D5BD7C3F48E75F6E4BA9F7ECFD5C0B94A2D67EA5E99DC2519D10D7BA7715DB47212FF6C2647EA348310947007DF1FFA013D777D2A441A55C937E969462D27B021260C81D6A73C"
			this.vcode=  options.vcode ? options.vcode :  "0FA71F92BCB3D7EF10330927E2C046792142DFFA2DD217FCFC1057C1003B460B7EFD011E3B650986"
			this.yzquickjiami =options.yzquickjiami ? options.yzquickjiami:''
			this.fromXinxi = options.fromXinxi? options.fromXinxi:'0'
			this.isgoumai=options.isgoumai? options.isgoumai:'0'
			this.xmxxForm= Object.assign({}, this.xmxxForm,{
				// company:this.companyData.name,
				danweiType:this.danweiType,
				company:this.companyName,
				keywords2:this.keywords2,
				comcode:this.comcode,
				vcode:this.vcode
			})
		
			this.getGongneng()
		},
	
		computed: {
			initDiquName() {
				if (this.initDiqu === '0' || this.initDiqu == '') return '全国'
				let arr = []
				this.initDiqu.split(',').map(item => {
					arr.push(areaMap[item])
				})
				return arr.join(',')
			},
		
			tabList() {
			      let list =  [ 
					  {
						name: "企业信息库",
					},
					{
						name: "项目信息"
					},
					{
						name: "招标分析"
					},
					{
						name: "中标分析"
					},
					{
						name: "代理分析"
					},
					{
						name: "找人脉"
					},
					{
						name: "查企业"
					},
				];
				//moSentiment企情权限，moEnterprise企业信息库
			      list.map((item,index) => {
						 this.changeTab=[]
						 /**
						  * 新逻辑20250227张家铭
						  * 逻辑：从信息页面进入企情分析时：企业信息库在第一个位置，如果无权限不显示该tab标签内容，
						  * 直接显示该企业身份状态下的项目信息,
						  * 从非信息页面进入时，无论有无权限均不显示企业信息库
						  * 非信息页面，日后的搜索,当前的企业监控 信息页面指标讯/工程信息页面
						  * 0非信息页 1 --信息页  
						*/
						
						if(this.fromXinxi=='1'){
							if(!this.userInfo.moEnterprise){
								list  = list.filter((item)=> item.name !=='企业信息库' )
								this.isQyxxkfirst=false
								this.tabName="项目信息"
							}else{
								this.isQyxxkfirst=true
								this.tabName="企业信息库"
							}
						}else{
							list  = list.filter((item)=> item.name !=='企业信息库' )
							this.isQyxxkfirst=false
							this.tabName="项目信息"
						}
						 //fromCompanyInfo为false,代表不是来自企业基本信息更换企业身份，即页面初始化时设置tabname
						 // if(!this.fromCompanyInfo){
							// if (!this.userInfo.moEnterprise ||this.userInfo.hyJibie=="免费会员" || this.userInfo.hyJibie=="高级会员" ||this.userInfo.hyJibie=="标准会员") {
							//   list  = list.filter((item)=> item.name !=='企业信息库' )
							//   this.isQyxxkfirst=false
							//   this.tabName="项目信息"
							// } else{
							// 	this.isQyxxkfirst=true
							// 	this.tabName="企业信息库"
							// }
						 // }
						  
							if(this.danweiType==2){
								list  = list.filter((item)=> item.name !=='中标分析' && item.name !=='代理分析')
							}
							if(this.danweiType==5){
								list  = list.filter((item)=> item.name !=='招标分析' && item.name !=='代理分析')
							}
							if(this.danweiType==1){
								list  = list.filter((item)=> item.name !=='招标分析' && item.name !=='中标分析')
							}
							this.changeTab=list
			         
			      });
			      return this.changeTab;
			},
			xiangmushaixuanList(){
				let arr=[]
				if(this.danweiType==2){
					arr=[
						{
							key: '0',
							value: '招标项目'
						},
						{
							key: '1',
							value: '招标相关项目'
						}
					]
				}else if(this.danweiType==5){
					arr=[
						{
							key: '0',
							value: '中标项目'
						},
						{
							key: '1',
							value: '参与项目'
						}
					]
				}else if(this.danweiType==1){
					arr=[{
						key: '0',
						value: '代理项目'
					}]
				}
				if(this.changeXiangmuName){
					this.initshaixuanName=arr[0].value
				}
				// console.log(arr,this.xiangmuType)
				return arr
			},
			
		},
		methods: {
			//次数用尽查企业只区分有权限和无权限，查企业不做限制查看该页面
			tobuy(){
				uni.$u.http
				.post('/wxapp/WxAppFuFeiSendMsgHandler.ashx', {
					location: this.location,
					ctid:'10917', // 9344为续费申请 9347为会员升级 9348为会员开通 10917是会员但查看次数已用尽
				}).then(rs => {
					
				}).catch(err => {
					uni.$u.toast(err.msg);
				})
				if(this.tabName == '找人脉'){
					// console.log('danweiType',this.danweiType)
					uni.redirectTo({
						url:'/pages/qiqing/pay/pay?type=' + 255 + '&pageurl=' + '/pages/qiqing/index' + '&comcode=' + this.comcode + '&vcode=' + this.vcode+ '&companyName=' + this.companyName + '&danweiType=' + this.danweiType+ '&keywords2=' + this.keywords2
					})
				}
				// else if(this.tabName == '查企业') {
				// 	uni.redirectTo({
				// 		url:'/pages/qiqing/pay/pay?type=' + 254 + '&pageurl=' + '/pages/qiqing/index' + '&comcode=' + this.comcode + '&vcode=' + this.vcode
				// 	})
				// }
			},
			
			goreport(){
				
				uni.navigateTo({
					url:'pay/pay-qiyebaogao?company=' + this.companyData.name + '&comcode=' + this.comcode + '&vcode=' + this.vcode +  '&danweiType=' + this.danweiType +'&callback=' + encodeURIComponent(this.pageUrl) 
				})
			},
			back() {
				uni.navigateBack({
					delta: 1
				})
			},
			goHome(){
				uni.switchTab({
					url:'/pages/index/index'
				})
			},
			getBottomH() {
				const query = uni.createSelectorQuery().in(this);
				// debugger
				query.select('.footer').boundingClientRect(data => {
					this.bottomH = data.height + 10 + 'px'
				}).exec();
			},
			//tab点击
			tabClick(e) {
				// 关闭下拉弹窗
				this.xiangmushaixuanShow = false
				this.diquShow = false
				this.timeShow = false
				
				
				this.isCishuyongjin = false;
				this.tabName=e.name
				this.tabIndex = e.index
				
				// console.log(e)
				//此判断用于tab是项目信息时，项目信息页需要调用getlist接口
				if(this.tabName =='项目信息'){
					this.isUpdateXmxx=true
				}else{
					this.isUpdateXmxx=false
				}
				
				  // console.log(1,this.isUpdateXmxx,this.xmxxAllow,this.cqyAllow,this.zrmAllow)
			},
			clickSearch(){
				// console.log(this.keywords2,22,this.xmxxForm.keywords2)
				this.isClickSearch=true
				this.searchFn()
				
			},
			//项目信息子组件搜索
			searchFn() {
				this.xmxxForm = Object.assign({}, this.xmxxForm, {
					company:this.companyData.name,
					keywords:this.keywords,
					keywords2:this.keywords2,
					danweiType: this.danweiType,
					time: this.initTimeCheck, //3:近三天；7：近一周；30：近一月；90：近三月；180：近半年；11：近一年
					stime: this.startDate,
					endtime: this.endDate,
					diqu: this.initDiquName,
					areacode: this.initDiqu === '0' ? '' : this.initDiqu,
					xiangmuType:this.xiangmuType,
					comcode:this.comcode,
					vcode:this.vcode
				});
				
				this.isFixed = false
				this.ispopClick = false
				console.log('项目信息searchfn',this.xmxxForm )
				
				

			},
			//更新项目信息
			updateXmxx(data){
				// console.log('更新项目信息',data)
				this.xmxxForm=data
			},
			//更新企业信息库
			updateQyxxk(data){
				// console.log('企业信息库',data)
				this.qyxxkForm=data
			},
			//收藏
			collectFn() {
				this.isshoucang = !this.isshoucang
				if (this.isshoucang) {
					uni.$u.toast('收藏成功');
				} else {
					uni.$u.toast('已取消收藏');
				}
				
			},
			//跳第二个我的-客服 已和张家铭确认20250320
			kefuClike() {
				uni.navigateTo({
					url:'/pages/user/service/service',
				})
			},
			//分享--同标讯
			shareClick(){
				this.showShare=true
			},
			//弹窗显示
			popupFn(type) {
				if(!this.xmxxAllow){
					this.gongnengList.map((item) => {
						// 返回参数中 “1”的isallow为true,说明有会员权限，在判断255权限，如果255的isAllow是true，则什么都不弹 ，否则弹购买查人脉,showBuycharenmai设置为true
						// ”1“的isallow为false 弹购买信息会员+查人脉,showBuyxinxi设置为true
						if (item.mid == 1) {
							if (item.isAllow) {
								list.map((x) => {
									if (x.mid == 255) {
										if (!x.isAllow) {
											this.showBuycharenmai = true
											this.isNeedQuanxian=true
											
										}
									}
								})
								
							} else {
									this.isNeedQuanxian=true
									this.showBuyxinxi = true
							}
						}
					})
					return
				}
				this.isFixed = true
				this.ispopClick = true
				//弹窗时fixed定位，弹窗位置要包含筛选框高度+标题栏高度
				const query = uni.createSelectorQuery().in(this);
				query.select('.shaixuan').boundingClientRect(data => {
					this.topHeight = (data && data.height) + this.titleTop
				}).exec();
				switch (type) {
					case 'danwei':
						this.xiangmushaixuanShow = !this.xiangmushaixuanShow
						this.timeShow = false
						this.diquShow = false
						break;
					case 'diqu':
						this.diquShow = !this.diquShow
						this.xiangmushaixuanShow = false
						this.timeShow = false
						break;
					case 'time':
						this.timeShow = !this.timeShow
						this.diquShow = false
						this.xiangmushaixuanShow = false
						break;
					default:
						this.xiangmushaixuanShow = false
						this.diquShow = false
						this.timeShow = false

				}
			},
			// 点击遮罩层关闭弹窗
			closeWrap() {
				this.xiangmushaixuanShow = false
				this.diquShow = false
				this.timeShow = false
				this.isFixed = false
				this.ispopClick = false
			},

			//点击筛选项目类型
			xiangmuTypeClick(item) {
				// console.log(item)
				this.changeXiangmuName=false
				this.xiangmuType = item.key
			},
			xiangmuTypeConfirm() {
				this.xiangmushaixuanShow = false
				this.xiangmushaixuanList.map((item)=>{
					if(item.key == this.xiangmuType){
						this.initshaixuanName=item.value
					}
				})
				// console.log(11,this.xiangmuType)
				this.isClickSearch=false
				this.searchFn()
			},
			xiangmuTypeReset() {
				this.xiangmuType='0'
			},
			// 禁止弹窗滚动
			moveHandle: function() {
				return false
			},
			
			//关注
			guanzhuClick(){
				uni.$u.http
					.post('/user/guanzhu/GuanzhuHandler.ashx', {
						location: this.location,
						comname:this.companyData.name,
						type: this.danweiType,
					})
					.then(rs => {
						 this.isJiankong = !this.isJiankong;
						  if (!this.isJiankong){
							 uni.$u.toast('已取消关注');
						
						  } else {
							uni.$u.toast('已关注');
						  }
					}).catch(err => {
						console.log(err)
						if(err.msg.includes('超过400')){
							this.chaochuShow=true
						}else{
							uni.$u.toast(err.msg || '监控接口异常');
						}
					});
			},
			// 未开通组件是否展示
			// getIshuiyuan(){
			// 	if(this.userInfo.hyJibie=="免费会员" || this.userInfo.hyJibie.includes("移动") || this.userInfo.hyJibie==''){
			// 		this.showWeikaitong=true
			// 	}else{
			// 		this.showWeikaitong=false
			// 	}
			// },
			 // 获取对应tab权限  项目信息、招标权限用247的isallow判断，其他对应类型判断 20250321
			getGongneng() {
			  // 247：企情分析-完整分析；248：企情分析-商机脉络；251：企情分析-基础分析；252：企情分析-市场分析；253：企情分析-竞对分析；
			  // 254：企情分析-企业信息；255：企情分析-联系方式；256：企情分析-商机预测
			  uni.$u.http
			  	.post('/public/ValidateAutMoHandler.ashx', {
			  		location: this.location,
			  		comcode: this.comcode,
			  		vcode: this.vcode,
			  		mids: "1,247,251,248,252,253,254,255,256",
			  	})
				.then((rs) => {
				  const { list } = rs;
				  // console.log(rs)
				  this.gongnengList = list || [];
					
				  this.gongnengList.map((item) => {
					// 返回参数中 “1”的isallow为true,说明有会员权限，在判断255权限，如果255的isAllow是true，则什么都不弹 ，否则弹购买查人脉,showBuycharenmai设置为true
					// ”1“的isallow为false 弹购买信息会员+查人脉,showBuyxinxi设置为true
					if (item.mid == 1) {
						if (item.isAllow) {
							list.map((x) => {
								if (x.mid == 255) {
									if (!x.isAllow) {
										//策划稿--查人脉无次数/不在服务期-每日首次弹出无权限弹窗
										  const today = new Date().toISOString().slice(0, 10); // 获取今天的日期 (YYYY-MM-DD)
										  const lastDate = uni.getStorageSync('buyrenmaiPopupDate') || '';
										  if (lastDate != today) {
											this.showBuycharenmai = true
											this.isNeedQuanxian=true
											uni.setStorageSync('buyrenmaiPopupDate', today); // 存储今天的日期
										  }
									}
								}
							})
							
						} else {
							//策划稿--查人脉无次数/不在服务期-每日首次弹出无权限弹窗
							  const today = new Date().toISOString().slice(0, 10); // 获取今天的日期 (YYYY-MM-DD)
							  const lastDate = uni.getStorageSync('buyrenmaiPopupDate') || '';
							  if (lastDate != today) {
								this.isNeedQuanxian=true
								this.showBuyxinxi = true
								uni.setStorageSync('buyrenmaiPopupDate', today); // 存储今天的日期
							}
						}
					}
					
					//是否是付费会员isFufeihuiyuan
					if (item.mid == 1) {
						this.isFufeihuiyuan=item.isAllow
					}
					  
					// 基本信息需要判断mid247 或者251。只要 一个为true,就展示基本信息
					
				  if (item.mid == 247) {
					if (!item.isAllow) {
					  this.gongnengList.map((x) => {
						if (x.mid == 251) {
						  this.xmxxAllow = x.isAllow;
						}
					  });
					} else {
					  this.xmxxAllow = item.isAllow;
					}
				  } else if (item.mid == 254){//查企业
					this.cqyAllow = item.isAllow;
					
					//查企业=解锁板块不显示，此页面不做限制
					const isshiyong = item.limitData.AuthKeyList[0].isShiyong
					this.cqyjiesuoShow = isshiyong
					this.cqyshengyucishu = item.limitData.LimitCount - item.limitData.CurrCount
				  }else if (item.mid == 255){//查人脉
					this.zrmAllow = item.isAllow;
					//找人脉-解锁板块是否显示
					const isshiyong = item.limitData.AuthKeyList[0].isShiyong
					this.zrmjiesuoShow = isshiyong
					this.zrmshengyucishu = item.limitData.LimitCount - item.limitData.CurrCount
				  }
				  });
				  this.isUpdateXmxx=true
				  // console.log(2,this.xmxxAllow,this.cqyAllow,this.zrmAllow)
				})
				.catch((err) => {
				  uni.$u.toast(err.msg || '接口异常');
				});
			},
			
			inputClick(){
				console.log(111)
				if(!this.xmxxAllow){
					this.gongnengList.map((item) => {
						// 返回参数中 “1”的isallow为true,说明有会员权限，在判断255权限，如果255的isAllow是true，则什么都不弹 ，否则弹购买查人脉,showBuycharenmai设置为true
						// ”1“的isallow为false 弹购买信息会员+查人脉,showBuyxinxi设置为true
						if (item.mid == 1) {
							if (item.isAllow) {
								list.map((x) => {
									if (x.mid == 255) {
										if (!x.isAllow) {
											this.showBuycharenmai = true
											this.isNeedQuanxian=true
											
										}
									}
								})
								
							} else {
									this.isNeedQuanxian=true
									this.showBuyxinxi = true
							}
						}
					})
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	@import "@/static/css/qiqing.scss";
	@import "@/static/css/index.scss";
	page {
		background: #FAFAFA;
	}

	.user-top {
		z-index: 99999;
		// z-index: 10071;
		position: relative;
	}
	.search-box{
		background-color: #fafafa;
		padding:20rpx;
		.u-input{
			font-size: 28rpx;
			color: #333;
			background: #fff;
			border-radius: 8rpx;
			border: 0;
		}
		.search-icon{
			margin-right: 30rpx;
			width: 30rpx;
			height: 30rpx;
		}
	}
	// 筛选
	.shaixuan {
		width: 100%;
		background: #fff;

		.filter-box {
			display: flex;

			.filter-item {
				display: flex;
				justify-content: center;
				align-items: center;
				flex: 1;

				width: 33.33%;
				line-height: 88rpx;

				&.active {
					view {
						color: #2F6DFE;
					}
				}

				view {
					max-width: 70%;
					overflow: hidden;
					text-overflow: ellipsis;
					white-space: nowrap;
					font-size: 28rpx;
					color: #3B3E45;
					font-weight: bold;
				}

				image {
					width: 24rpx;
					height: 24rpx;
					margin: -4rpx 0 0 4rpx;
					vertical-align: middle;
				}
			}
		}
	}

	.isFixed {
		position: fixed;
		// top: 127rpx;
		z-index: 999;
		// z-index: 10074;
	}

	.xmtab {
		position: relative;

		.line {
			width: 100%;
			// height: 1rpx;
			// background: #E8E8E8;
			position: absolute;
			left: 0;
			bottom: 5rpx;
			&:after{
				content: '';
				position: absolute;
				left: 0;
				width: 100%;
				border-top: 1rpx solid #E8E8E8;
			}
		}
	}

	// footer
	.footer {
		width: 100%;
		padding: 24rpx 0 30rpx;
		display: flex;
		justify-content: space-between;
		background: #fff;
		position: fixed;
		bottom: 0;
		left: 0;
		border-top: 1rpx solid #EEEEEE;
		z-index: 9;

		.footer-left {
			width: 100%;
			// flex: 1;
			
			image {
				width: 40rpx;
				height: 40rpx;
			}

			.footer-left-item {
				flex: 1;
				padding:0 40rpx;
				view {
					margin-top: -2rpx;
					font-size: 28rpx;
					color: #6C717E;
				}

				text-align: center;

				button {
					border: 0;
					background: transparent !important;
					padding: 0;
					line-height: 38rpx;

					&::after {
						border: initial;
					}

				}
			}
		}

		.footer-right {
			margin: 4rpx 28rpx 0 0;

			view {
				width: 218rpx;
				height: 80rpx;
				line-height: 80rpx;
				font-size: 28rpx;
				color: #FFFFFF;
				text-align: center;
				background: linear-gradient(90deg, #1F91FF 0%, #1D11FB 100%);
				border-radius: 10rpx;
				
			}

			.lijijiankong {
				background: #2F6DFE;
			}

			.jiankongzhong {
				color: #2F6DFE;
				background: #E8EFFF;

				image {
					width: 40rpx;
					height: 40rpx;
					margin-right: 10rpx;
					margin-top: -4rpx;
					vertical-align: middle;
				}
			}
		}
	}

	.danwei-box {
		width: 100%;
		background: #fff;
		position: absolute;
		padding: 0 30rpx 150rpx 30rpx;
		box-sizing: border-box;
	}

	
</style>
<style lang="scss">
	.shaixuan-filter {
		.u-tag--primary--plain {
			border-color: #2478fe !important;
			background: rgba(47, 109, 254, 0.06) !important;
	
			.u-tag__text--primary--plain {
				color: #2478fe !important;
				font-size: 24rpx;
			}
		}
	}
	
	.qiyezhuye{
		.filterWrap {
			z-index: 11;
			width: 100%;
			height: 100%;
			position: fixed;
		}
		
		.filterCont {
			position: relative;
			z-index: 10070;
			width: 100%;
			height: 100%;
		}
		
		.filterCont2 {
			height: auto;
			background-color: #fff;
			.title{
				font-size: 28rpx;
				font-weight: bold;
				margin-bottom: 10rpx;
			}
			.tagwrap{
				view{
					width: auto;
				}
			}
		}
		.u-skeleton__wrapper__content__rows{
			width: 100%  !important;
		}
		.u-popup .u-icon__icon{
			color: #333 !important;
		}
		
	}
	
	// 企业基本信息弹窗的关闭按钮放大点击区域
	.company-box .u-popup__content__close--top-right{
		top: 20rpx !important;
		right: 20rpx !important;
		padding: 10rpx;
	}
	.pinfanTips {
		background-color: #fff;
		width: 100%;
		padding: 343rpx 0;
	
		.pinfan {
			display: flex;
			flex-wrap: wrap;
			justify-content: center;
		}
	
		.text1 {
			margin-top: 24rpx;
			font-size: 28rpx;
			font-weight: bold;
			text-align: center;
		}
	
		.text2 {
			margin-top: 36rpx;
			color: #606266;
			font-size: 24rpx;
			text-align: center;
		}
	}
	.baomingdizhi_btn{
		width: 144rpx;
		height: 52rpx;
		background: #2F6DFE;
		border-radius: 6rpx;
		line-height: 52rpx;
		text-align: center;
		font-size: 24rpx;
		color: #FFFFFF;
		margin: 0 30rpx;
	}
	.total{
		display: flex;
		line-height: 80rpx;
		padding-left: 24rpx;
		font-size: 28rpx;
		color: #3B3E45;
		background: #fafafa;
		text{
			color: #2F6DFE;
		}
	}
</style>